﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.SqlClient;
using System.Data;
using System.Collections;

using XJX.BusinessLayer;

namespace XJX.Page
{
    /// <summary>
    ///Log 的摘要说明
    /// </summary>
    public class Log
    {
        public Log() { }

        //验证用户登录信息
        public static int Verification_User_Log(string mobile, string pwd, out string ReturnFieldValue)
        {
            int b;

            string str = System.Configuration.ConfigurationManager.ConnectionStrings["DataConn"].ConnectionString;

            XJX.BusinessLayer.Log fy = new XJX.BusinessLayer.Log(str);

            try
            {
                b = fy.Verification_User_Log(mobile, pwd, out ReturnFieldValue);
            }
            catch (SqlException e)
            {
                throw new System.Exception(e.Message);
            }
            return b;
        }

        //修改密码
        public static bool Modify_One_Family_PWD(string UID, string PWD)
        {
            bool b;

            string str = System.Configuration.ConfigurationManager.ConnectionStrings["DataConn"].ConnectionString;

            XJX.BusinessLayer.Log fy = new XJX.BusinessLayer.Log(str);

            try
            {
                b = fy.Modify_One_Family_PWD(UID, PWD);
            }
            catch (SqlException e)
            {
                throw new System.Exception(e.Message);
            }
            return b;
        }

        public static bool Add_New_Log
            (
            string UID
            )
        {
            bool b;

            string str = System.Configuration.ConfigurationManager.ConnectionStrings["DataConn"].ConnectionString;

            XJX.BusinessLayer.Log bs = new XJX.BusinessLayer.Log(str);

            try
            {
                b = bs.Add_New_Log(UID);
            }
            catch (SqlException e)
            {
                throw new System.Exception(e.Message);
            }
            return b;
        }

    }

    ////////////////////////////////////////////////////////////////////////////以下登录信息类属性

    public class LogInfo
    {
        public int ID;
        public string UID;
        public string CDT;
    }

}